// 导入vue-router
import { createRouter, createWebHistory } from "vue-router";

// 动态导入组件

const LayoutVue = () => import("@/src-client/views/layout.vue");
const TicketVue = () => import("@/src-client/views/operation/ticket.vue");
const LoginVue = () => import("@/src-client/views/Login.vue");
const OrderVue = () => import("@/src-client/views/operation/Order.vue");
const MemberVue = () => import("@/src-client/views/user/member.vue");
const UserAvatarVue = () => import("@/src-client/views/user/UserAvatar.vue");
const UserInfoVue = () => import("@/src-client/views/user/UserInfo.vue");
const UserResetPasswordVue = () => import("@/src-client/views/user/UserResetPassword.vue");



// 定义路由关系
const routes = [
  {
    path: "/login",
    component: LoginVue
  },
  {
    path: "/",
    component: LayoutVue,
    redirect: "/operation/ticket",
    children: [
      { path: "operation/ticket", component: TicketVue },
      { path: "operation/order", component: OrderVue },
      { path: "user/member", component: MemberVue },
      { path: "user/avatar", component: UserAvatarVue },
      { path: "user/info", component: UserInfoVue },
      { path: "user/resetpassword", component: UserResetPasswordVue },
    ],
  },
];

// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes,
});

// 导出路由实例
export default router;
